from typing import Set
import pygame
from plant import Plant
from abc import ABC, abstractmethod
from base import *


class PlantingArea(pygame.sprite.Sprite, ABC):

    sign = "PlantingArea-sign"

    def __init__(
        self,
        plantGroup: pygame.sprite.AbstractGroup,
        plantingTarget: Set[int],
        x: int,
        y: int,
        width: int,
        height: int,
    ) -> None:
        self.plantGroup = plantGroup
        """植物组，种植后植物的实际落地点"""
        self.plantingTarget: Set[int] = plantingTarget
        """可种植目标"""
        self.width = width
        """宽度"""
        self.height = height
        """高度"""
        self.plants: Set[int] = None
        """已种植类型"""
        self.image = pygame.Surface(
            (width, height), pygame.SRCALPHA, depth=32, masks=(255, 255, 255, 100)
        )
        self.rect = self.image.get_rect()
        self.rect.left = x
        self.rect.bottom = y

    @abstractmethod
    def addPlant(self, plant: Plant):
        """种植"""
